﻿<Window x:Class="WpfWordsLearner.Views.FileTranslateView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:conv="clr-namespace:WpfWordsLearner.Converters"
        xmlns:ext="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="File translation"
        Width="450"
        Height="200">
	<Grid>
		<Grid.Resources>
			<conv:NullToVisibility x:Key="NullToVis" />
			<conv:ListToStringConv x:Key="ListToStr"/>
		</Grid.Resources>
		<Grid.RowDefinitions>
			<RowDefinition Height="30" />
			<RowDefinition />
		</Grid.RowDefinitions>
		<StackPanel Orientation="Horizontal">
			<TextBox Width="220" Text="{Binding FileName, Mode=TwoWay}" />
			<Button Width="50"
			        Margin="3,0,0,0"
			        Command="{Binding ChooseCommand}"
			        Content="Choose" />
			<Button Width="60"
			        Margin="3,0,0,0"
			        Command="{Binding TranslateCommand}"
			        Content="Translate" />
			<CheckBox VerticalAlignment="Center"
			          Content="Sort (in abc)"
			          Foreground="Black"
			          IsChecked="{Binding UseSort}" />
		</StackPanel>
		<TextBox Grid.Row="1"
		         AcceptsReturn="True"
		         IsReadOnly="True"
		         Text="{Binding Path=Translated, Converter={StaticResource ListToStr}}"
		         Visibility="{Binding Translated,
		                              Converter={StaticResource NullToVis}}" />
		<ext:BusyIndicator Grid.Row="1"
		                   BusyContent="Wait while translation completed"
		                   IsBusy="{Binding Running}" />
	</Grid>
</Window>
